package lx;

public class demo5 {
    //爬楼梯问题 可以一次爬1个台阶 2个 ,甚至3个(改编
    public static void main(String[] args) {
        System.out.println(getSum(20));
    }

    public static int getSum(int n) {
        if (n == 1)
            return 1;
        if (n == 2)
            return 2;
        if (n == 3)
            return 4;
        return getSum(n - 1) + getSum(n - 2)+getSum(n - 3);
    }
}
